diff options
author | Todd Poynor <toddpoynor@google.com> | 2013-04-05 13:56:44 -0700 |
---|---|---|
committer | Todd Poynor <toddpoynor@google.com> | 2013-04-05 13:56:44 -0700 |
commit | 12b868488bc5abfb5fc0910aa34b32d6209073df (patch) | |
tree | 5d37b78d71a0070a73fa8bcead7dce040119f554 /fs/sysfs | |
parent | 0bb6ee4f4587d219cfbb328e8a14f608405b52b9 (diff) | |
parent | ae7859181482fcfe38d9352bd0932fa45456bdd0 (diff) | |
download | kernel_samsung_tuna-12b868488bc5abfb5fc0910aa34b32d6209073df.zip kernel_samsung_tuna-12b868488bc5abfb5fc0910aa34b32d6209073df.tar.gz kernel_samsung_tuna-12b868488bc5abfb5fc0910aa34b32d6209073df.tar.bz2 |
Merge tag 'v3.0.72' into android-3.0
This is the 3.0.72 stable release
Diffstat (limited to 'fs/sysfs')
-rw-r--r-- | fs/sysfs/dir.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 567b3db..7cbc585 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c @@ -917,6 +917,8 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) ino = parent_sd->s_ino; if (filldir(dirent, ".", 1, filp->f_pos, ino, DT_DIR) == 0) filp->f_pos++; + else + return 0; } if (filp->f_pos == 1) { if (parent_sd->s_parent) @@ -925,6 +927,8 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) ino = parent_sd->s_ino; if (filldir(dirent, "..", 2, filp->f_pos, ino, DT_DIR) == 0) filp->f_pos++; + else + return 0; } mutex_lock(&sysfs_mutex); for (pos = sysfs_dir_pos(ns, parent_sd, filp->f_pos, pos); @@ -955,10 +959,21 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir) return 0; } +static loff_t sysfs_dir_llseek(struct file *file, loff_t offset, int whence) +{ + struct inode *inode = file->f_path.dentry->d_inode; + loff_t ret; + + mutex_lock(&inode->i_mutex); + ret = generic_file_llseek(file, offset, whence); + mutex_unlock(&inode->i_mutex); + + return ret; +} const struct file_operations sysfs_dir_operations = { .read = generic_read_dir, .readdir = sysfs_readdir, .release = sysfs_dir_release, - .llseek = generic_file_llseek, + .llseek = sysfs_dir_llseek, }; |