Skip to content

Commit

Permalink
sysfs: Store the sysfs inode in an unsigned int.
Browse files Browse the repository at this point in the history
Store the sysfs inode number in an unsided int because
ida inode allocator can return at most a 31 bit number,
reducing the size of struct sysfs_dirent by 8 bytes
on 64bit platforms.

Signed-off-by: Eric W. Biederman <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ebiederm authored and gregkh committed Jan 24, 2012
1 parent 15a3382 commit cafa6b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions fs/sysfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static void sysfs_deactivate(struct sysfs_dirent *sd)
rwsem_release(&sd->dep_map, 1, _RET_IP_);
}

static int sysfs_alloc_ino(ino_t *pino)
static int sysfs_alloc_ino(unsigned int *pino)
{
int ino, rc;

Expand All @@ -243,7 +243,7 @@ static int sysfs_alloc_ino(ino_t *pino)
return rc;
}

static void sysfs_free_ino(ino_t ino)
static void sysfs_free_ino(unsigned int ino)
{
spin_lock(&sysfs_ino_lock);
ida_remove(&sysfs_ino_ida, ino);
Expand Down
2 changes: 1 addition & 1 deletion fs/sysfs/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct sysfs_dirent {

unsigned short s_flags;
umode_t s_mode;
ino_t s_ino;
unsigned int s_ino;
struct sysfs_inode_attrs *s_iattr;
};

Expand Down

0 comments on commit cafa6b5

Please sign in to comment.