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

Pull vfs pile 1 from Al Viro:
 "Unfortunately, this merge window it'll have a be a lot of small piles -
  my fault, actually, for not keeping #for-next in anything that would
  resemble a sane shape ;-/

  This pile: assorted fixes (the first 3 are -stable fodder, IMO) and
  cleanups + %pd/%pD formats (dentry/file pathname, up to 4 last
  components) + several long-standing patches from various folks.

  There definitely will be a lot more (starting with Miklos'
  check_submount_and_drop() series)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
  direct-io: Handle O_(D)SYNC AIO
  direct-io: Implement generic deferred AIO completions
  add formats for dentry/file pathnames
  kvm eventfd: switch to fdget
  powerpc kvm: use fdget
  switch fchmod() to fdget
  switch epoll_ctl() to fdget
  switch copy_module_from_fd() to fdget
  git simplify nilfs check for busy subtree
  ibmasmfs: don't bother passing superblock when not needed
  don't pass superblock to hypfs_{mkdir,create*}
  don't pass superblock to hypfs_diag_create_files
  don't pass superblock to hypfs_vm_create_files()
  oprofile: get rid of pointless forward declarations of struct super_block
  oprofilefs_create_...() do not need superblock argument
  oprofilefs_mkdir() doesn't need superblock argument
  don't bother with passing superblock to oprofile_create_stats_files()
  oprofile: don't bother with passing superblock to ->create_files()
  don't bother passing sb to oprofile_create_files()
  coh901318: don't open-code simple_read_from_buffer()
  ...
  • Loading branch information
torvalds committed Sep 5, 2013
2 parents 2386a3b + 02afc27 commit 45d9a22
Show file tree
Hide file tree
Showing 52 changed files with 738 additions and 502 deletions.
9 changes: 9 additions & 0 deletions Documentation/printk-formats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ UUID/GUID addresses:
Where no additional specifiers are used the default little endian
order with lower case hex characters will be printed.

dentry names:
%pd{,2,3,4}
%pD{,2,3,4}

For printing dentry name; if we race with d_move(), the name might be
a mix of old and new ones, but it won't oops. %pd dentry is a safer
equivalent of %s dentry->d_name.name we used to use, %pd<n> prints
n last components. %pD does the same thing for struct file.

struct va_format:

%pV
Expand Down
22 changes: 11 additions & 11 deletions arch/alpha/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ op_axp_stop(void)
}

static int
op_axp_create_files(struct super_block *sb, struct dentry *root)
op_axp_create_files(struct dentry *root)
{
int i;

Expand All @@ -115,23 +115,23 @@ op_axp_create_files(struct super_block *sb, struct dentry *root)
char buf[4];

snprintf(buf, sizeof buf, "%d", i);
dir = oprofilefs_mkdir(sb, root, buf);
dir = oprofilefs_mkdir(root, buf);

oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
oprofilefs_create_ulong(dir, "enabled", &ctr[i].enabled);
oprofilefs_create_ulong(dir, "event", &ctr[i].event);
oprofilefs_create_ulong(dir, "count", &ctr[i].count);
/* Dummies. */
oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
oprofilefs_create_ulong(dir, "kernel", &ctr[i].kernel);
oprofilefs_create_ulong(dir, "user", &ctr[i].user);
oprofilefs_create_ulong(dir, "unit_mask", &ctr[i].unit_mask);
}

if (model->can_set_proc_mode) {
oprofilefs_create_ulong(sb, root, "enable_pal",
oprofilefs_create_ulong(root, "enable_pal",
&sys.enable_pal);
oprofilefs_create_ulong(sb, root, "enable_kernel",
oprofilefs_create_ulong(root, "enable_kernel",
&sys.enable_kernel);
oprofilefs_create_ulong(sb, root, "enable_user",
oprofilefs_create_ulong(root, "enable_user",
&sys.enable_user);
}

Expand Down
17 changes: 8 additions & 9 deletions arch/avr32/oprofile/op_model_avr32.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,30 +97,29 @@ static irqreturn_t avr32_perf_counter_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}

static int avr32_perf_counter_create_files(struct super_block *sb,
struct dentry *root)
static int avr32_perf_counter_create_files(struct dentry *root)
{
struct dentry *dir;
unsigned int i;
char filename[4];

for (i = 0; i < NR_counter; i++) {
snprintf(filename, sizeof(filename), "%u", i);
dir = oprofilefs_mkdir(sb, root, filename);
dir = oprofilefs_mkdir(root, filename);

oprofilefs_create_ulong(sb, dir, "enabled",
oprofilefs_create_ulong(dir, "enabled",
&counter[i].enabled);
oprofilefs_create_ulong(sb, dir, "event",
oprofilefs_create_ulong(dir, "event",
&counter[i].event);
oprofilefs_create_ulong(sb, dir, "count",
oprofilefs_create_ulong(dir, "count",
&counter[i].count);

/* Dummy entries */
oprofilefs_create_ulong(sb, dir, "kernel",
oprofilefs_create_ulong(dir, "kernel",
&counter[i].kernel);
oprofilefs_create_ulong(sb, dir, "user",
oprofilefs_create_ulong(dir, "user",
&counter[i].user);
oprofilefs_create_ulong(sb, dir, "unit_mask",
oprofilefs_create_ulong(dir, "unit_mask",
&counter[i].unit_mask);
}

Expand Down
20 changes: 10 additions & 10 deletions arch/mips/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static int op_mips_setup(void)
return 0;
}

static int op_mips_create_files(struct super_block *sb, struct dentry *root)
static int op_mips_create_files(struct dentry *root)
{
int i;

Expand All @@ -42,16 +42,16 @@ static int op_mips_create_files(struct super_block *sb, struct dentry *root)
char buf[4];

snprintf(buf, sizeof buf, "%d", i);
dir = oprofilefs_mkdir(sb, root, buf);

oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
oprofilefs_create_ulong(sb, dir, "exl", &ctr[i].exl);
dir = oprofilefs_mkdir(root, buf);

oprofilefs_create_ulong(dir, "enabled", &ctr[i].enabled);
oprofilefs_create_ulong(dir, "event", &ctr[i].event);
oprofilefs_create_ulong(dir, "count", &ctr[i].count);
oprofilefs_create_ulong(dir, "kernel", &ctr[i].kernel);
oprofilefs_create_ulong(dir, "user", &ctr[i].user);
oprofilefs_create_ulong(dir, "exl", &ctr[i].exl);
/* Dummy. */
oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
oprofilefs_create_ulong(dir, "unit_mask", &ctr[i].unit_mask);
}

return 0;
Expand Down
20 changes: 10 additions & 10 deletions arch/powerpc/kvm/powerpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,39 +825,39 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
#endif
#ifdef CONFIG_KVM_MPIC
case KVM_CAP_IRQ_MPIC: {
struct file *filp;
struct fd f;
struct kvm_device *dev;

r = -EBADF;
filp = fget(cap->args[0]);
if (!filp)
f = fdget(cap->args[0]);
if (!f.file)
break;

r = -EPERM;
dev = kvm_device_from_filp(filp);
dev = kvm_device_from_filp(f.file);
if (dev)
r = kvmppc_mpic_connect_vcpu(dev, vcpu, cap->args[1]);

fput(filp);
fdput(f);
break;
}
#endif
#ifdef CONFIG_KVM_XICS
case KVM_CAP_IRQ_XICS: {
struct file *filp;
struct fd f;
struct kvm_device *dev;

r = -EBADF;
filp = fget(cap->args[0]);
if (!filp)
f = fdget(cap->args[0]);
if (!f.file)
break;

r = -EPERM;
dev = kvm_device_from_filp(filp);
dev = kvm_device_from_filp(f.file);
if (dev)
r = kvmppc_xics_connect_vcpu(dev, vcpu, cap->args[1]);

fput(filp);
fdput(f);
break;
}
#endif /* CONFIG_KVM_XICS */
Expand Down
28 changes: 14 additions & 14 deletions arch/powerpc/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static void op_powerpc_stop(void)
model->global_stop();
}

static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
static int op_powerpc_create_files(struct dentry *root)
{
int i;

Expand All @@ -128,9 +128,9 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
* There is one mmcr0, mmcr1 and mmcra for setting the events for
* all of the counters.
*/
oprofilefs_create_ulong(sb, root, "mmcr0", &sys.mmcr0);
oprofilefs_create_ulong(sb, root, "mmcr1", &sys.mmcr1);
oprofilefs_create_ulong(sb, root, "mmcra", &sys.mmcra);
oprofilefs_create_ulong(root, "mmcr0", &sys.mmcr0);
oprofilefs_create_ulong(root, "mmcr1", &sys.mmcr1);
oprofilefs_create_ulong(root, "mmcra", &sys.mmcra);
#ifdef CONFIG_OPROFILE_CELL
/* create a file the user tool can check to see what level of profiling
* support exits with this kernel. Initialize bit mask to indicate
Expand All @@ -142,7 +142,7 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
* If the file does not exist, then the kernel only supports SPU
* cycle profiling, PPU event and cycle profiling.
*/
oprofilefs_create_ulong(sb, root, "cell_support", &sys.cell_support);
oprofilefs_create_ulong(root, "cell_support", &sys.cell_support);
sys.cell_support = 0x1; /* Note, the user OProfile tool must check
* that this bit is set before attempting to
* user SPU event profiling. Older kernels
Expand All @@ -160,11 +160,11 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
char buf[4];

snprintf(buf, sizeof buf, "%d", i);
dir = oprofilefs_mkdir(sb, root, buf);
dir = oprofilefs_mkdir(root, buf);

oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
oprofilefs_create_ulong(dir, "enabled", &ctr[i].enabled);
oprofilefs_create_ulong(dir, "event", &ctr[i].event);
oprofilefs_create_ulong(dir, "count", &ctr[i].count);

/*
* Classic PowerPC doesn't support per-counter
Expand All @@ -173,14 +173,14 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
* Book-E style performance monitors, we do
* support them.
*/
oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
oprofilefs_create_ulong(dir, "kernel", &ctr[i].kernel);
oprofilefs_create_ulong(dir, "user", &ctr[i].user);

oprofilefs_create_ulong(sb, dir, "unit_mask", &ctr[i].unit_mask);
oprofilefs_create_ulong(dir, "unit_mask", &ctr[i].unit_mask);
}

oprofilefs_create_ulong(sb, root, "enable_kernel", &sys.enable_kernel);
oprofilefs_create_ulong(sb, root, "enable_user", &sys.enable_user);
oprofilefs_create_ulong(root, "enable_kernel", &sys.enable_kernel);
oprofilefs_create_ulong(root, "enable_user", &sys.enable_user);

/* Default to tracing both kernel and user */
sys.enable_kernel = 1;
Expand Down
13 changes: 5 additions & 8 deletions arch/s390/hypfs/hypfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,23 @@
#define UPDATE_FILE_MODE 0220
#define DIR_MODE 0550

extern struct dentry *hypfs_mkdir(struct super_block *sb, struct dentry *parent,
const char *name);
extern struct dentry *hypfs_mkdir(struct dentry *parent, const char *name);

extern struct dentry *hypfs_create_u64(struct super_block *sb,
struct dentry *dir, const char *name,
extern struct dentry *hypfs_create_u64(struct dentry *dir, const char *name,
__u64 value);

extern struct dentry *hypfs_create_str(struct super_block *sb,
struct dentry *dir, const char *name,
extern struct dentry *hypfs_create_str(struct dentry *dir, const char *name,
char *string);

/* LPAR Hypervisor */
extern int hypfs_diag_init(void);
extern void hypfs_diag_exit(void);
extern int hypfs_diag_create_files(struct super_block *sb, struct dentry *root);
extern int hypfs_diag_create_files(struct dentry *root);

/* VM Hypervisor */
extern int hypfs_vm_init(void);
extern void hypfs_vm_exit(void);
extern int hypfs_vm_create_files(struct super_block *sb, struct dentry *root);
extern int hypfs_vm_create_files(struct dentry *root);

/* debugfs interface */
struct hypfs_dbfs_file;
Expand Down
Loading

0 comments on commit 45d9a22

Please sign in to comment.