Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  isofs: Fix lseek() to position beyond 4 GB
  vfs: remove unused MNT_STRICTATIME
  vfs: show unreachable paths in getcwd and proc
  vfs: only add " (deleted)" where necessary
  vfs: add prepend_path() helper
  vfs: __d_path: dont prepend the name of the root dentry
  ia64: perfmon: add d_dname method
  vfs: add helpers to get root and pwd
  cachefiles: use path_get instead of lone dget
  fs/sysv/super.c: add support for non-PDP11 v7 filesystems
  V7: Adjust sanity checks for some volumes
  Add v7 alias
  v9fs: fixup for inode_setattr being removed

Manual merge to take Al's version of the fs/sysv/super.c file: it merged
cleanly, but Al had removed an unnecessary header include, so his side
was better.
  • Loading branch information
Linus Torvalds committed Aug 11, 2010
2 parents 062e27e + 66a362a commit 5af568c
Show file tree
Hide file tree
Showing 15 changed files with 223 additions and 130 deletions.
15 changes: 8 additions & 7 deletions arch/ia64/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2191,8 +2191,15 @@ pfmfs_delete_dentry(struct dentry *dentry)
return 1;
}

static char *pfmfs_dname(struct dentry *dentry, char *buffer, int buflen)
{
return dynamic_dname(dentry, buffer, buflen, "pfm:[%lu]",
dentry->d_inode->i_ino);
}

static const struct dentry_operations pfmfs_dentry_operations = {
.d_delete = pfmfs_delete_dentry,
.d_dname = pfmfs_dname,
};


Expand All @@ -2202,8 +2209,7 @@ pfm_alloc_file(pfm_context_t *ctx)
struct file *file;
struct inode *inode;
struct path path;
char name[32];
struct qstr this;
struct qstr this = { .name = "" };

/*
* allocate a new inode
Expand All @@ -2218,11 +2224,6 @@ pfm_alloc_file(pfm_context_t *ctx)
inode->i_uid = current_fsuid();
inode->i_gid = current_fsgid();

sprintf(name, "[%lu]", inode->i_ino);
this.name = name;
this.len = strlen(name);
this.hash = inode->i_ino;

/*
* allocate a new dcache entry
*/
Expand Down
15 changes: 12 additions & 3 deletions fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1263,10 +1263,19 @@ static int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
return PTR_ERR(fid);

retval = p9_client_setattr(fid, &p9attr);
if (retval >= 0)
retval = inode_setattr(dentry->d_inode, iattr);
if (retval < 0)
return retval;

return retval;
if ((iattr->ia_valid & ATTR_SIZE) &&
iattr->ia_size != i_size_read(dentry->d_inode)) {
retval = vmtruncate(dentry->d_inode, iattr->ia_size);
if (retval)
return retval;
}

setattr_copy(dentry->d_inode, iattr);
mark_inode_dirty(dentry->d_inode);
return 0;
}

/**
Expand Down
32 changes: 12 additions & 20 deletions fs/cachefiles/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,7 @@ static int cachefiles_daemon_tag(struct cachefiles_cache *cache, char *args)
*/
static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args)
{
struct fs_struct *fs;
struct dentry *dir;
struct path path;
const struct cred *saved_cred;
int ret;

Expand All @@ -573,24 +572,21 @@ static int cachefiles_daemon_cull(struct cachefiles_cache *cache, char *args)
}

/* extract the directory dentry from the cwd */
fs = current->fs;
read_lock(&fs->lock);
dir = dget(fs->pwd.dentry);
read_unlock(&fs->lock);
get_fs_pwd(current->fs, &path);

if (!S_ISDIR(dir->d_inode->i_mode))
if (!S_ISDIR(path.dentry->d_inode->i_mode))
goto notdir;

cachefiles_begin_secure(cache, &saved_cred);
ret = cachefiles_cull(cache, dir, args);
ret = cachefiles_cull(cache, path.dentry, args);
cachefiles_end_secure(cache, saved_cred);

dput(dir);
path_put(&path);
_leave(" = %d", ret);
return ret;

notdir:
dput(dir);
path_put(&path);
kerror("cull command requires dirfd to be a directory");
return -ENOTDIR;

Expand Down Expand Up @@ -628,8 +624,7 @@ static int cachefiles_daemon_debug(struct cachefiles_cache *cache, char *args)
*/
static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args)
{
struct fs_struct *fs;
struct dentry *dir;
struct path path;
const struct cred *saved_cred;
int ret;

Expand All @@ -649,24 +644,21 @@ static int cachefiles_daemon_inuse(struct cachefiles_cache *cache, char *args)
}

/* extract the directory dentry from the cwd */
fs = current->fs;
read_lock(&fs->lock);
dir = dget(fs->pwd.dentry);
read_unlock(&fs->lock);
get_fs_pwd(current->fs, &path);

if (!S_ISDIR(dir->d_inode->i_mode))
if (!S_ISDIR(path.dentry->d_inode->i_mode))
goto notdir;

cachefiles_begin_secure(cache, &saved_cred);
ret = cachefiles_check_in_use(cache, dir, args);
ret = cachefiles_check_in_use(cache, path.dentry, args);
cachefiles_end_secure(cache, saved_cred);

dput(dir);
path_put(&path);
//_leave(" = %d", ret);
return ret;

notdir:
dput(dir);
path_put(&path);
kerror("inuse command requires dirfd to be a directory");
return -ENOTDIR;

Expand Down
Loading

0 comments on commit 5af568c

Please sign in to comment.