]> rtime.felk.cvut.cz Git - zynq/linux.git/blobdiff - fs/fuse/dir.c
Apply preempt_rt patch-4.9-rt1.patch.xz
[zynq/linux.git] / fs / fuse / dir.c
index 6a4d0e5418a179def0e5d4da4d3adbbcf3a82cd0..310e2aabbb0dcc364e9ffaec90e3f8fe18994ff9 100644 (file)
@@ -286,6 +286,11 @@ const struct dentry_operations fuse_dentry_operations = {
        .d_release      = fuse_dentry_release,
 };
 
+const struct dentry_operations fuse_root_dentry_operations = {
+       .d_init         = fuse_dentry_init,
+       .d_release      = fuse_dentry_release,
+};
+
 int fuse_valid_type(int m)
 {
        return S_ISREG(m) || S_ISDIR(m) || S_ISLNK(m) || S_ISCHR(m) ||
@@ -1186,7 +1191,7 @@ static int fuse_direntplus_link(struct file *file,
        struct inode *dir = d_inode(parent);
        struct fuse_conn *fc;
        struct inode *inode;
-       DECLARE_WAIT_QUEUE_HEAD_ONSTACK(wq);
+       DECLARE_SWAIT_QUEUE_HEAD_ONSTACK(wq);
 
        if (!o->nodeid) {
                /*
@@ -1734,8 +1739,6 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr)
                 * This should be done on write(), truncate() and chown().
                 */
                if (!fc->handle_killpriv) {
-                       int kill;
-
                        /*
                         * ia_mode calculation may have used stale i_mode.
                         * Refresh and recalculate.
@@ -1745,12 +1748,11 @@ static int fuse_setattr(struct dentry *entry, struct iattr *attr)
                                return ret;
 
                        attr->ia_mode = inode->i_mode;
-                       kill = should_remove_suid(entry);
-                       if (kill & ATTR_KILL_SUID) {
+                       if (inode->i_mode & S_ISUID) {
                                attr->ia_valid |= ATTR_MODE;
                                attr->ia_mode &= ~S_ISUID;
                        }
-                       if (kill & ATTR_KILL_SGID) {
+                       if ((inode->i_mode & (S_ISGID | S_IXGRP)) == (S_ISGID | S_IXGRP)) {
                                attr->ia_valid |= ATTR_MODE;
                                attr->ia_mode &= ~S_ISGID;
                        }